package com.example.japinhands.ui.screen

import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Text
import androidx.compose.material3.TextField
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp

@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun LeftRightItem(
    leftLabel: String,
    rightLabel: String,
    leftText: String,
    rightText: String,
    onLeftChange: (String) -> Unit,
    onRightChange: (String) -> Unit
) {
    Row(
        modifier = Modifier.fillMaxWidth()
    ) {
        TextField(
            modifier = Modifier
                .weight(1f)
                .padding(8.dp),
            value = leftText,
            onValueChange = onLeftChange,
            label = { Text(text = leftLabel) }
        )
        TextField(
            modifier = Modifier
                .weight(1f)
                .padding(8.dp),
            value = rightText,
            onValueChange = onRightChange,
            label = { Text(text = rightLabel) }
        )
    }
}